﻿using MvCamCtrl.NET;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.ToolTip;

namespace LKL_Code.Camera
{   
    public interface ICamera
    {
        /// <summary>
        /// 控件操作
        /// </summary>
        Control_Operation Control_Operation { get; }

        /// <summary>
        /// 相机参数
        /// </summary>


        /// <summary>
        /// 采集开关
        /// </summary>
        bool m_bGrabbing { get; set; }

        /// <summary>
        /// 记录开关
        /// </summary>
        bool m_bRecord { get; set; }

        /// <summary>
        /// //渲染位图
        /// </summary>
        bool m_bRenderByBitmap { get; set; }

        /// <summary>
        /// 宽
        /// </summary>
        UInt32 m_nCurWidth { get; set; }

        /// <summary>
        /// 高
        /// </summary>
        UInt32 m_nCurHeight { get; set; }

        #region ComboxList 使用，接口实现一个数组
        /// <summary>
        /// 添加一个字符串到数组中(ComboxList中使用)
        /// </summary>
        /// <param name="ComboxItem"></param>
        void AddComboxItem(string ComboxItem);

        List<string> ComboxItems { get; set; }

        /// <summary>
        /// 获取指定索引处的字符串
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        string GetComboxItem(int index);

        /// <summary>
        /// 返回整个字符串数组
        /// </summary>
        /// <returns></returns>
        string[] GetAllComboxItem();

        /// <summary>
        /// 字符串个数
        /// </summary>
        int Count { get; }
        #endregion

        /// <summary>
        ///  图片1画笔-pictureBox1.CreateGraphics();
        /// </summary>
        Graphics Picture1_CreateGraphics { get; set; }

        /// <summary>
        ///  图片2画笔-pictureBox2.CreateGraphics();
        /// </summary>
        Graphics Picture2_CreateGraphics { get; set; }

        /// <summary>
        /// 图片1宽度-pictureBox1.Width
        /// </summary>
        int PictureBox1_W { get; set; }

        /// <summary>
        /// 图片1高度pictureBox1.Height
        /// </summary>
        int PictureBox1_H { get; set; }

        /// <summary>
        /// 图片2宽度-pictureBox2.Width
        /// </summary>
        int PictureBox2_W { get; set; }

        /// <summary>
        /// 图片2高度-pictureBox2.Height
        /// </summary>
        int PictureBox2_H { get; set; }

        /// <summary>
        /// 图片1句柄-pictureBox1.Handle
        /// </summary>
        IntPtr Picture1_Handle { get; set; }

        /// <summary>
        /// 图片2句柄-pictureBox2.Handle
        /// </summary>
        IntPtr Picture2_Handle { get; set; }

        /// <summary>
        ///  点击触发模式暂停5s
        /// </summary>
        bool bnTriggerMode_Checked { get; set; }

        /// <summary>
        /// 曝光
        /// </summary>
        string tbExposure_Text { get; set; }

        /// <summary>
        /// 增益
        /// </summary>
         string tbGain_Text { get; set; }

        /// <summary>
        /// 帧率
        /// </summary>
         string tbFrameRate_Text { get; set; }

        /// <summary>
        /// 像素格式
        /// </summary>
         string tbPixelFormat_Text { get; set; }

        /// <summary>
        /// 显示错误信息 
        /// </summary>
        /// <param name="csMessage"></param>
        /// <param name="nErrorNum"></param>
        void ShowErrorMsg(string csMessage, int nErrorNum);

        /// <summary>
        /// 查找设备
        /// </summary>
        void DeviceListAcq();

        /// <summary>
        /// 打开设备
        /// </summary>
        void OpenDevice(int cbDeviceListSelectedIndex);

        /// <summary>
        /// 关闭设备
        /// </summary>
        void CloseDevice();

        /// <summary>
        /// 连续模式
        /// </summary>
        void OpenContinuesMode();

        /// <summary>
        /// 触发模式
        /// </summary>
        void TriggerMode();

        /// <summary>
        /// 接受线程进程
        /// </summary>
        void ReceiveThreadProcess();

        /// <summary>
        /// 开始采集
        /// </summary>
        void StartGrab();

        /// <summary>
        /// 停止采集
        /// </summary>
        void StopGrab();

        /// <summary>
        /// 软触发
        /// </summary>
        void _cbSoftTrigger_CheckedChanged_incident();

        /// <summary>
        /// 软触发一次
        /// </summary>
        void TriggerExec();

        /// <summary>
        /// 保存Bmp照片
        /// </summary>
        void SaveBmp();

        /// <summary>
        /// 保存Jpg照片
        /// </summary>
        void SaveJpg();

        /// <summary>
        /// 保存Png照片
        /// </summary>
        void SavePng();

        /// <summary>
        /// 保存Tiff照片
        /// </summary>
        void SaveTiff();

        /// <summary>
        /// 获取参数
        /// </summary>
        void GetParam();

        /// <summary>
        /// 设置参数
        /// </summary>
        void SetParam();

        /// <summary>
        /// 界面关闭，释放资源
        /// </summary>
        void CloseClick();

        /// <summary>
        /// 开始录像
        /// </summary>
        void StartRecord();

        /// <summary>
        /// 停止录像
        /// </summary>
        void StopRecord();


    }
    public interface IDisplayable
    {
        void Pass_PictureParameter();
    }

    /// <summary>
    /// 控件操作
    /// </summary>
    public struct Control_Operation
    {
        //-----------------使能标志-----------------//
        /// <summary>
        /// 打开设备使能
        /// </summary>
        public bool bnOpen_Enabled_MARK { get; internal set; } //按钮--打开设备使能

        /// <summary>
        /// 关闭设备使能
        /// </summary>
        /// 
        public bool bnClose_Enabled_MARK { get; internal set; }//按钮--关闭设备使能

        /// <summary>
        /// 开始采集使能
        /// </summary>
        public bool bnStartGrab_Enabled_MARK { get; internal set; }//按钮--开始采集使能

        /// <summary>
        /// 关闭采集使能
        /// </summary>
        public bool bnStopGrab_Enabled_MARK { get; internal set; }//按钮--关闭采集使能

        /// <summary>
        /// 连续模式使能
        /// </summary>
        public bool bnContinuesMode_Enabled_MARK { get; internal set; }//连续模式使能

        /// <summary>
        /// 触发模式使能
        /// </summary>
        public bool bnTriggerMode_Enabled_MARK { get; internal set; }   //触发模式使能

        /// <summary>
        /// 软触发模式
        /// </summary>
        public bool cbSoftTrigger_Enabled_MARK { get; internal set; }   //软触发模式

        /// <summary>
        /// 软触发一次
        /// </summary>
        public bool bnTriggerExec_Enabled_MARK { get; internal set; }   //软触发一次

        /// <summary>
        /// 曝光参数
        /// </summary>
        public bool tbExposure_Enabled_MARK { get; internal set; }      //曝光参数

        /// <summary>
        /// 增益
        /// </summary>
        public bool tbGain_Enabled_MARK { get; internal set; }          //增益

        /// <summary>
        /// 频率
        /// </summary>
        public bool tbFrameRate_Enabled_MARK { get; internal set; }    //频率

        /// <summary>
        /// 像素格式
        /// </summary>
        public bool tbPixelFormat_Enabled_MARK { get; internal set; } //像素格式

        /// <summary>
        /// 获得参数
        /// </summary>
        public bool bnGetParam_Enabled_MARK { get; internal set; } //获得参数

        /// <summary>
        /// 设置参数
        /// </summary>
        public bool bnSetParam_Enabled_MARK { get; internal set; } //设置参数

        /// <summary>
        /// 开始录像
        /// </summary>
        public bool bnStartRecord_Enabled_MARK { get; internal set; } //开始录像

        /// <summary>
        /// 停止录像
        /// </summary>
        public bool bnStopRecord_Enabled_MARK { get; internal set; } //停止录像

        /// <summary>
        /// 保存BMP
        /// </summary>
        public bool bnSaveBmp_Enabled_MARK { get; internal set; } //保存BMP

        /// <summary>
        /// 保存JPG
        /// </summary>
        public bool bnSaveJpg_Enabled_MARK { get; internal set; } //保存JPG


        /// <summary>
        /// 保存TIFF
        /// </summary>
        public bool bnSaveTiff_Enabled_MARK { get; internal set; } //保存TIFF

        /// <summary>
        /// 保存PNG
        /// </summary>
        public bool bnSavePng_Enabled_MARK { get; internal set; } //保存PNG

        //-----------------控件选中点击-----------------//

        /// <summary>
        /// 连续模式被选中
        /// </summary>
        public bool bnContinuesMode_Checked_MARK { get; internal set; }//连续模式被选中

        /// <summary>
        /// 触发模式被选中
        /// </summary>
        public bool bnTriggerMode_Checked_MARK { get; internal set; }//触发模式被选中

        /// <summary>
        /// 软触发模式被勾选中
        /// </summary>
        public bool cbSoftTrigger_Checked_MARK { get; set; }//软触发模式被勾选中
        //public bool cbSoftTrigger_Checked_MARK;



    }
}
